﻿
using DA.Core.Common;
using DA.Core.Mes;
using DA.Core.Plcs;
using DA.Core.Stations;
using DA.Core.WorkFlows;
using Prism.Ioc;
using Prism.Modularity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;

namespace DA.Core
{
    public class CoreModule : IModule
    {
        public void OnInitialized(IContainerProvider containerProvider)
        {
            //var stationManager = containerProvider.Resolve<StationManager>();
            //stationManager.Init();

        }

        public void RegisterTypes(IContainerRegistry containerRegistry)
        {
            containerRegistry.RegisterSingleton<Configurations>();
            containerRegistry.RegisterSingleton<PlcManager>();
            containerRegistry.RegisterSingleton<ClientManager>();
            containerRegistry.RegisterSingleton<StationManager>();
            //containerRegistry.RegisterSingleton<ILog, LogManager>();
            containerRegistry.RegisterSingleton<IMessage, MessageManager>();

            containerRegistry.Register<IBasePlc, Modbus>();
            containerRegistry.Register<IClient, SocketClient>();
            containerRegistry.Register<IStation, CommonStation>();

            containerRegistry.Register<IWorkFlow, CommonWorkFlow1>("CommonWorkFlow1");
            containerRegistry.Register<IWorkFlow, CommonWorkFlow2>("CommonWorkFlow2");
        }
    }
}
